import { Logger, MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { UserController } from './core/controller/user.controller';
import { TodoController } from './core/controller/todo.controller';
import { NestJSController } from './core/controller/NestJS.controller';
import { ArticleController } from './core/controller/Article.controller';
import { ProductController } from './core/controller/Product.controller';
import { BookController } from './core/controller/Book.controller';
import { StudentCotroller } from './core/controller/Student.controller';
import { StudentService } from './core/service/student.service';
import { Product1Controller } from './core/controller/Product1.controller';
import { ProductService } from './core/service/product.service';
import { StudentsService } from './core/service/students.serivice';
import { StudentsController } from './core/controller/Students.controller';
import { UsersService } from './core/service/users.service';
import { UsersController } from './core/controller/users.controller';
import { Product2Controller } from './core/controller/Product2.controller';
import { Product2Service } from './core/service/product2.service';
import { OrderController } from './core/controller/order.controller';
import { OrderService } from './core/service/order.service';
import { CoreModule } from './core/core.module';
import { OrderModule } from './order/order.module';
import { LoggerMiddleware } from './middleware/logger.middleware';

@Module({
  imports: [CoreModule,OrderModule],
  controllers: [],
  providers: [],
})
export class AppModule implements NestModule{
  configure(consumer: MiddlewareConsumer) {
   consumer.apply(LoggerMiddleware).forRoutes('/user')//当前路由
  }
}
